#include "CppUTest/TestHarness.h"
#include "CppUTestExt/MockSupport.h"

extern "C"
{
#undef CHECK
#include "platform_assert.h"
}

TEST_GROUP(platform_assert_test)
{
    void setup()
    {
    }

    void teardown()
    {
        mock("IO").checkExpectations();
        mock().clear();
    }
};

TEST(platform_assert_test, should_check_expr)
{
    CHECK(true);
}

static bool should_check_expr_and_return_stub(void)
{
    CHECK_AND_RETURN(true, false);
    CHECK_AND_RETURN(false, true);
    return false;
}
TEST(platform_assert_test, should_check_expr_and_return)
{
    CHECK_TRUE(should_check_expr_and_return_stub());
}
